package jp.sinya.temicontact;

import android.app.Application;
import android.content.Context;
import android.content.Intent;

import jp.sinya.temicontact.service.LocalService;
import jp.sinya.temicontact.service.RemoteService;
import jp.sinya.temicontact.utils.PubnubUtils;
import jp.sinya.temicontact.utils.RandomUtils;

/**
 * @author Koizumi Sinya
 * @date 2018/01/11. 20:56
 * @edithor
 * @date
 */
public class MyApplication extends Application {
    public static Context context;
    /**
     * 在没有用户登录的条件下，暂时用这个作为判断设备唯一的条件（也可以使用获取设备id的方式）
     */
    public static String id;

    @Override
    public void onCreate() {
        super.onCreate();
        context = this;

        id = RandomUtils.getRandomString(10);
        PubnubUtils.getInstance().init();

        startService(new Intent(this, LocalService.class));
        startService(new Intent(this, RemoteService.class));
    }

}
